package com.ruoyi.stock.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.stock.domain.StockInquery;
import com.ruoyi.stock.mapper.StockInqueryMapper;
import com.ruoyi.stock.service.IStockInqueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 持仓咨询Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-30
 */
@Service
public class StockInqueryServiceImpl implements IStockInqueryService 
{
    @Autowired
    private StockInqueryMapper stockInqueryMapper;

    /**
     * 查询持仓咨询
     * 
     * @param id 持仓咨询主键
     * @return 持仓咨询
     */
    @Override
    public StockInquery selectStockInqueryById(Long id)
    {
        return stockInqueryMapper.selectStockInqueryById(id);
    }

    /**
     * 查询持仓咨询列表
     * 
     * @param stockInquery 持仓咨询
     * @return 持仓咨询
     */
    @Override
    public List<StockInquery> selectStockInqueryList(StockInquery stockInquery)
    {
        return stockInqueryMapper.selectStockInqueryList(stockInquery);
    }

    @Override
    public List<StockInquery> selectStockInqueryListByField(StockInquery stockInquery) {
        return stockInqueryMapper.selectStockInqueryListByField(stockInquery);
    }

    /**
     * 新增持仓咨询
     * 
     * @param stockInquery 持仓咨询
     * @return 结果
     */
    @Override
    public int insertStockInquery(StockInquery stockInquery)
    {
        stockInquery.setCreateTime(DateUtils.getNowDate());
        return stockInqueryMapper.insertStockInquery(stockInquery);
    }

    /**
     * 修改持仓咨询
     * 
     * @param stockInquery 持仓咨询
     * @return 结果
     */
    @Override
    public int updateStockInquery(StockInquery stockInquery)
    {
        stockInquery.setUpdateTime(DateUtils.getNowDate());
        return stockInqueryMapper.updateStockInquery(stockInquery);
    }

    /**
     * 批量删除持仓咨询
     * 
     * @param ids 需要删除的持仓咨询主键
     * @return 结果
     */
    @Override
    public int deleteStockInqueryByIds(Long[] ids)
    {
        return stockInqueryMapper.deleteStockInqueryByIds(ids);
    }

    /**
     * 删除持仓咨询信息
     * 
     * @param id 持仓咨询主键
     * @return 结果
     */
    @Override
    public int deleteStockInqueryById(Long id)
    {
        return stockInqueryMapper.deleteStockInqueryById(id);
    }
}
